package com.knowledge.vo.params;

import lombok.Data;

/**
 * @author zzz
 * @create 2022-02-10 16:18
 */
@Data
public class PageParams {
    private int page = 1;

    private int pageSize = 10;

    private Long categoryId;

    private Long tagId;

    private String year;

    private String month;

    private String token;
    /**
     * 是否查询收藏的文章
     */
    private Integer favorite;

    /**
     * 查询用户收藏的文章
     */
    private Long userId;

    private String keyword;
    /**
     * 查询自己的文章标记
     */
    private Integer myArticleFlag;

    public PageParams(){

    }

    public PageParams(int page, int pageSize){
        this.page = page;
        this.pageSize = pageSize;
    }

    //传递6的话变成06
    public String getMonth(){
        if (this.month != null && this.month.length() == 1){
            return "0"+this.month;
        }
        return this.month;
    }
}
